package javabase.enhancestring.split;

import java.util.StringTokenizer;

public class SplitDemo2 {

	public static void main(String[] args) {
		String str = null;
		StringBuilder stringBuilder = new StringBuilder();
		for (int i = 0; i < 1000; i++) {
			stringBuilder.append(i);
			stringBuilder.append(";");
		}
		str = stringBuilder.toString();
		StringTokenizer st = new StringTokenizer(str, ";");
		long lt = System.currentTimeMillis();
		for (int i = 0; i < 10000; i++) {
			while(st.hasMoreTokens()) {
				st.nextToken();
			}
			st = new StringTokenizer(str, ";");
		}
		System.out.println("耗时：" + (System.currentTimeMillis() - lt));
	}

}
